[Ivy]
[>Created: Tue Mar 04 11:46:55 ICT 2014]
144623064362EF21 3.17 #module
>Proto >Proto Collection #zClass
Ls0 LoginProcess Big #zClass
Ls0 RD #cInfo
Ls0 #process
Ls0 @TextInP .ui2RdDataAction .ui2RdDataAction #zField
Ls0 @TextInP .rdData2UIAction .rdData2UIAction #zField
Ls0 @TextInP .resExport .resExport #zField
Ls0 @TextInP .type .type #zField
Ls0 @TextInP .processKind .processKind #zField
Ls0 @AnnotationInP-0n ai ai #zField
Ls0 @TextInP .xml .xml #zField
Ls0 @TextInP .responsibility .responsibility #zField
Ls0 @RichDialogInitStart f0 '' #zField
Ls0 @RichDialogProcessEnd f1 '' #zField
Ls0 @RichDialogProcessEnd f6 '' #zField
Ls0 @GridStep f7 '' #zField
Ls0 @RichDialog f10 '' #zField
Ls0 @PushWFArc f9 '' #zField
Ls0 @Alternative f12 '' #zField
Ls0 @PushWFArc f13 '' #zField
Ls0 @PushWFArc f11 '' #zField
Ls0 @GridStep f15 '' #zField
Ls0 @PushWFArc f16 '' #zField
Ls0 @PushWFArc f14 '' #zField
Ls0 @RichDialogProcessEnd f18 '' #zField
Ls0 @Alternative f19 '' #zField
Ls0 @PushWFArc f8 '' #zField
Ls0 @RichDialogProcessStart f5 '' #zField
Ls0 @PushWFArc f21 '' #zField
Ls0 @PushWFArc f4 '' #zField
Ls0 @GridStep f20 '' #zField
Ls0 @RichDialogProcessStart f3 '' #zField
Ls0 @PushWFArc f17 '' #zField
Ls0 @PushWFArc f22 '' #zField
Ls0 @PushWFArc f2 '' #zField
>Proto Ls0 Ls0 LoginProcess #zField
Ls0 f0 guid 144623064477E558 #txt
Ls0 f0 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f0 method start() #txt
Ls0 f0 disableUIEvents true #txt
Ls0 f0 inParameterDecl 'ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent methodEvent = event as ch.ivyteam.ivy.richdialog.exec.RdMethodCallEvent;
<> param = methodEvent.getInputArguments();
' #txt
Ls0 f0 outParameterDecl '<> result;
' #txt
Ls0 f0 outActionCode ivy.log.info("Init"); #txt
Ls0 f0 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>start()</name>
        <nameStyle>7,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f0 62 150 20 20 13 0 #rect
Ls0 f0 @|RichDialogInitStartIcon #fIcon
Ls0 f1 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f1 62 318 20 20 13 0 #rect
Ls0 f1 @|RichDialogProcessEndIcon #fIcon
Ls0 f6 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f6 470 406 20 20 13 0 #rect
Ls0 f6 @|RichDialogProcessEndIcon #fIcon
Ls0 f7 actionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f7 actionTable 'out=in;
' #txt
Ls0 f7 actionCode 'import vn.axonactive.vision.utils.BeanUtils;
import vn.axonactive.vision.UserBean;

//ivy.session.logoutSessionUser();
Boolean result = ivy.session.loginSessionUser(in.username, in.password);
UserBean userBean = BeanUtils.findBean("userBean") as UserBean;

if(result) {
	 userBean.setLoggedIn(true);
	 in.setIsLoggedIn(true);
} else {
	 userBean.setLoggedIn(false);
	 in.setIsLoggedIn(false);
}' #txt
Ls0 f7 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f7 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>authenticate user</name>
        <nameStyle>17,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f7 454 172 36 24 20 -2 #rect
Ls0 f7 @|StepIcon #fIcon
Ls0 f10 targetWindow NEW:card: #txt
Ls0 f10 targetDisplay TOP #txt
Ls0 f10 richDialogId vn.axonactive.vision.Main #txt
Ls0 f10 startMethod start() #txt
Ls0 f10 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f10 requestActionDecl '<> param;' #txt
Ls0 f10 responseActionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f10 responseMappingAction 'out=in;
' #txt
Ls0 f10 windowConfiguration '* ' #txt
Ls0 f10 isAsynch false #txt
Ls0 f10 isInnerRd true #txt
Ls0 f10 userContext '* ' #txt
Ls0 f10 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Main Page</name>
        <nameStyle>9,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f10 366 276 36 24 20 -2 #rect
Ls0 f10 @|RichDialogIcon #fIcon
Ls0 f9 expr out #txt
Ls0 f9 393 300 474 407 #arcP
Ls0 f12 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f12 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Check if authentication passed</name>
        <nameStyle>30,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f12 458 234 28 28 14 0 #rect
Ls0 f12 @|AlternativeIcon #fIcon
Ls0 f13 expr out #txt
Ls0 f13 472 196 472 234 #arcP
Ls0 f11 expr in #txt
Ls0 f11 outCond 'in.isLoggedIn == true' #txt
Ls0 f11 462 252 402 280 #arcP
Ls0 f15 actionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f15 actionTable 'out=in;
' #txt
Ls0 f15 actionCode 'import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext; 

FacesContext.getCurrentInstance()
	.addMessage(null, 
			new FacesMessage(FacesMessage.SEVERITY_ERROR,"Error!", "Wrong Username or Password"));
' #txt
Ls0 f15 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f15 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>Return message to user</name>
        <nameStyle>22,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f15 694 236 36 24 20 -2 #rect
Ls0 f15 @|StepIcon #fIcon
Ls0 f16 expr in #txt
Ls0 f16 486 248 694 248 #arcP
Ls0 f16 0 0.21060958019815915 0 0 #arcLabel
Ls0 f14 expr out #txt
Ls0 f14 695 260 488 410 #arcP
Ls0 f18 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f18 238 406 20 20 13 0 #rect
Ls0 f18 @|RichDialogProcessEndIcon #fIcon
Ls0 f19 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f19 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>If User already logged in</name>
        <nameStyle>25,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f19 234 218 28 28 14 0 #rect
Ls0 f19 @|AlternativeIcon #fIcon
Ls0 f8 expr out #txt
Ls0 f8 472 106 472 172 #arcP
Ls0 f5 guid 144631533E175F24 #txt
Ls0 f5 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f5 actionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f5 actionTable 'out=in;
' #txt
Ls0 f5 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>onBtnLoginClick</name>
        <nameStyle>15,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f5 462 86 20 20 13 0 #rect
Ls0 f5 @|RichDialogProcessStartIcon #fIcon
Ls0 f21 expr in #txt
Ls0 f21 outCond 'in.isLoggedIn == false' #txt
Ls0 f21 248 246 248 406 #arcP
Ls0 f4 expr in #txt
Ls0 f4 258 236 366 281 #arcP
Ls0 f20 actionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f20 actionTable 'out=in;
' #txt
Ls0 f20 actionCode 'import vn.axonactive.vision.UserBean;
import vn.axonactive.vision.utils.BeanUtils;

UserBean userBean = BeanUtils.findBean("userBean") as UserBean;

in.setIsLoggedIn(userBean.isLoggedIn());' #txt
Ls0 f20 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f20 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>check userBean 
logged in status</name>
        <nameStyle>32,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f20 230 164 36 24 20 -2 #rect
Ls0 f20 @|StepIcon #fIcon
Ls0 f3 guid 14467E04B15A3529 #txt
Ls0 f3 type vn.axonactive.vision.Login.LoginData #txt
Ls0 f3 actionDecl 'vn.axonactive.vision.Login.LoginData out;
' #txt
Ls0 f3 actionTable 'out=in;
' #txt
Ls0 f3 @C|.xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <name>onLoginPageLoad</name>
        <nameStyle>15,5,7
</nameStyle>
    </language>
</elementInfo>
' #txt
Ls0 f3 238 110 20 20 13 0 #rect
Ls0 f3 @|RichDialogProcessStartIcon #fIcon
Ls0 f17 expr out #txt
Ls0 f17 248 130 248 164 #arcP
Ls0 f22 expr out #txt
Ls0 f22 248 188 248 218 #arcP
Ls0 f2 expr out #txt
Ls0 f2 72 170 72 318 #arcP
>Proto Ls0 .type vn.axonactive.vision.Login.LoginData #txt
>Proto Ls0 .processKind HTML_DIALOG #txt
>Proto Ls0 .xml '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<elementInfo>
    <language>
        <swimlaneLabel>Login Page Initialize</swimlaneLabel>
        <swimlaneLabel>On Page Load Event</swimlaneLabel>
        <swimlaneLabel>On Button Login Click</swimlaneLabel>
        <swimlaneLabel></swimlaneLabel>
    </language>
    <swimlaneSize>192</swimlaneSize>
    <swimlaneSize>192</swimlaneSize>
    <swimlaneSize>480</swimlaneSize>
    <swimlaneColor>-26317</swimlaneColor>
    <swimlaneColor>-13210</swimlaneColor>
    <swimlaneColor>-16724788</swimlaneColor>
</elementInfo>
' #txt
>Proto Ls0 -8 -8 16 16 16 26 #rect
>Proto Ls0 '' #fIcon
Ls0 f5 mainOut f8 tail #connect
Ls0 f8 head f7 mainIn #connect
Ls0 f10 mainOut f9 tail #connect
Ls0 f9 head f6 mainIn #connect
Ls0 f7 mainOut f13 tail #connect
Ls0 f13 head f12 in #connect
Ls0 f12 out f11 tail #connect
Ls0 f11 head f10 mainIn #connect
Ls0 f12 out f16 tail #connect
Ls0 f16 head f15 mainIn #connect
Ls0 f15 mainOut f14 tail #connect
Ls0 f14 head f6 mainIn #connect
Ls0 f19 out f21 tail #connect
Ls0 f21 head f18 mainIn #connect
Ls0 f19 out f4 tail #connect
Ls0 f4 head f10 mainIn #connect
Ls0 f3 mainOut f17 tail #connect
Ls0 f17 head f20 mainIn #connect
Ls0 f20 mainOut f22 tail #connect
Ls0 f22 head f19 in #connect
Ls0 f0 mainOut f2 tail #connect
Ls0 f2 head f1 mainIn #connect
